package com.rc.pojo.po.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;

// Auto generate by mybatis-flex, do not modify it.
public class ConsumerTableDef extends TableDef {

    /**
     * 移动端游客用户表 实体类。

 @author 27806
 @since 2024-06-15
     */
    public static final ConsumerTableDef CONSUMER = new ConsumerTableDef();

    /**
     * 游客用户id
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    public final QueryColumn SEX = new QueryColumn(this, "sex");

    public final QueryColumn NAME = new QueryColumn(this, "name");

    public final QueryColumn PHONE = new QueryColumn(this, "phone");

    public final QueryColumn AVATAR = new QueryColumn(this, "avatar");

    /**
     * open id
     */
    public final QueryColumn OPEN_ID = new QueryColumn(this, "open_id");

    /**
     * 余额
     */
    public final QueryColumn BALANCE = new QueryColumn(this, "balance");

    public final QueryColumn NICK_NAME = new QueryColumn(this, "nick_name");

    /**
     * 用户创建时间
     */
    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    public final QueryColumn UPDATE_TIME = new QueryColumn(this, "update_time");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, SEX, NAME, PHONE, AVATAR, OPEN_ID, BALANCE, NICK_NAME, CREATE_TIME, UPDATE_TIME};

    public ConsumerTableDef() {
        super("rc", "consumer");
    }

    private ConsumerTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public ConsumerTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new ConsumerTableDef("rc", "consumer", alias));
    }

}
